﻿using System.Windows;
using PSE.Deployment.Engine.Enums;

namespace PSE.Deployment.SetupBase.UI
{
    public partial class GroupCancelActionSelection : BaseWindow
    {
        public StepGroupCancelAction CancelAction { get; set; }

        public GroupCancelActionSelection(string message)
        {
            this.InitializeComponent();
            txtMessage.Text = message;
        }

        public new StepGroupCancelAction ShowDialog()
        {
            base.ShowDialog();
            return this.CancelAction;
        }

        void btnOk_Click(object sender, RoutedEventArgs e)
        {
            if (radCancelParent.IsChecked.GetValueOrDefault())           
                this.CancelAction = StepGroupCancelAction.CancelParent;
            else if (radStopParent.IsChecked.GetValueOrDefault())
                this.CancelAction = StepGroupCancelAction.StopParent;
            else if (radContinue.IsChecked.GetValueOrDefault())
                this.CancelAction = StepGroupCancelAction.CancelOnlyGroup;

            this.Close();
        }
    }
}